package huixue.cn.com.rxapp.ui;

import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Bundle;

import butterknife.BindView;
import butterknife.ButterKnife;
import huixue.cn.com.library.util.LogUtils;
import huixue.cn.com.rxapp.R;
import huixue.cn.com.rxapp.base.SimpleActivity;
import huixue.cn.com.rxapp.widget.RatioView;

public class RatioViewActivity extends SimpleActivity {


    @BindView(R.id.rv_img)
    RatioView rvImg;

    @Override
    public int getLayout() {
        return R.layout.activity_ratio_view;
    }

    @Override
    public void initView() {

    }

    @Override
    public void addEvent() {


        BitmapFactory.Options options = new BitmapFactory.Options();
        options.inJustDecodeBounds = true;
        Bitmap bitmap = BitmapFactory.decodeResource(getResources(),R.mipmap.banner,options);

        float ratio =  options.outWidth/ options.outHeight;
        LogUtils.e("ratio=="+ratio);
        rvImg.setWh_ratio(ratio);
        rvImg.requestLayout();
        //findViewById(R.id.root).requestLayout();
    }


}
